<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/29
 * Time: 10:06
 */
include_once "../../app/member/include/config.inc.php";
include_once "../../resource/lottery/result/Js_Class.php";
$ball = $_GET['ball'];
$result = array();
$sql = array(
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=1",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=2",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=3",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=4",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=5",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=6",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=7",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=8",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=9",
    "select count(1) from lottery_result_cq WHERE TO_DAYS(datetime) = TO_DAYS(NOW()) AND ball_$ball=10"
);
foreach ($sql as $v) {
    $res = $mysqli->query($v);
    $res = $res->fetch_row();
    array_push($result, $res);
}

echo json_encode($result);
$mysqli->close();
